package org.isource.pojo;

public class LineCounter {
	private int lineNum;

	private int counter;

	public LineCounter(int lineNum) {
		this.lineNum = lineNum;
		this.counter = 1;
	}

	public void addCounter() {
		counter++;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + lineNum;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		LineCounter other = (LineCounter) obj;
		if (lineNum != other.lineNum)
			return false;
		return true;
	}
	
	@Override
	public String toString() {
		return "[" + lineNum + ", " + counter + "]";
	}
}
